def read1(input_file1):
    lines = open(input_file1).readlines()
    target = []
    opinion = []
    for i in range(0, len(lines), 4):
        target.append(lines[i + 2])
        opinion.append(lines[i + 3])
    return target, opinion


def write(input_file1, output_file_2, output_file_3):
    target, opinion = read1(input_file1)

    fp = open(output_file_2, 'w')
    for seg in range(len(target)):
        fp.write(target[seg])

    fp = open(output_file_3, 'w')
    for seg in range(len(opinion)):
        fp.write(opinion[seg])


if __name__ == "__main__":
    file1 = 'data/tmp/res_test.txt'
    # file2 = 'data/14lap/sentence_test_1.txt'
    file3 = 'data/tmp/14res/target_test.txt'
    file4 = 'data/tmp/14res/opinion_test.txt'

    write(file1, file3, file4)
